<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="cn.school.entity.Admin"%>
<%@page import="cn.school.service.AdminService"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zhuce</title>
</head>
<body>
<%
	request.setCharacterEncoding("utf-8");
	String name=request.getParameter("username");
	String pass=request.getParameter("pass");
	AdminService adminService=new AdminService();
	Admin admin=adminService.login(name,pass);
	
	//if(name.startsWith("shuaige")&&pass.equals("123456")){
	if(admin!=null){	
		//session记录你的信息
		session.setAttribute("USER_LOGIN", admin);
		//request.getRequestDispatcher("success.jsp").forward(request, response);
		response.sendRedirect("newSuccess.jsp");
		return;
	}
	response.sendRedirect("newLogin.jsp?msg=error input");
%>
</body>
</html>